<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
    <style>
        .big{
            font-size: 80px;
            font-weight: 900;
        }
        .bigred {
            font-size: 80px;
            font-weight: 900;
            color: red;
        }
        .active {
            color: red;
        }
        .normal {
            color: gray;
        }
        .active1 {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <p>v-bind: 绑定标签属性，使得属性值成为一个变量</p>
    <p>动态样式：修改内容比较精细时，用style；修改内容比较多时用class</p>
    <div id="app">
        <p v-bind:class="p1" :qwer="df">海尔兄弟：打雷要下雨，雷欧～</p>
        <p>动态样式-通过v-bind绑定class或者style，使样式随着变量变化</p>
        <p :style="{fontSize: size+'px'}">天要下雨，娘要嫁人</p>
        <p :style="fresStyle">会freeStyle的那个人，已经没有free了。。。</p>
        <hr>
        <!-- 变量替换 -->
        <div :class="c1">我是一段文字。。。</div>
        <!-- 字符串拼接 -->
        <div :class="c1+'red'">我是一段文字。。。</div>
        <!-- 判断 -->
        <div :class="isLogin?'active':'normal'">动态样式</div>
        <button @click="isLogin = !isLogin">toggle</button>
        <!-- 判断 -->
        <div :class="{active: isLogin}">满足条件才有class，否则没有</div>
        <!-- 大杂烩 -->
        <div :class="['class1', {active: isLogin}, isLogin?'active1':'normal1',c1+'red']">各种class的处理方式</div>
    </div>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                p1: 'xiayule',
                df: 'lolm',
                size: 40,
                fresStyle: {
                    color: 'blue',
                    backgroundColor: 'yellow',
                    border: '1px solid orange'
                },
                c1: 'big',
                isLogin: true
            }
        })
    </script>
</body>
</html>